<!DOCTYPE html>
<html>
<head>
    <title></title>
    <#include "/header.html">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/news/topic.css">

    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/datepicker/datepicker3.css"/>
    <script src="${request.contextPath}/statics/plugins/datepicker/bootstrap-datepicker.js"></script>
    <script src="${request.contextPath}/statics/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>

    <script src="${request.contextPath}/statics/plugins/ueditor/ueditor.config.js"></script>
    <script src="${request.contextPath}/statics/plugins/ueditor/ueditor.all.js"></script>
    <script src="${request.contextPath}/statics/plugins/ueditor/ueditor.all.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/ueditor/lang/zh-cn/zh-cn.js"></script>
    <script src="${request.contextPath}/statics/plugins/ueditor/ueditor.parse.js"></script>


    <!--<script src="${request.contextPath}/statics/plugins/bootstrap-3.3.7-dist/js/locales/zh.js"></script>-->
    <script src="${request.contextPath}/statics/plugins/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
    <script src="${request.contextPath}/statics/plugins/bootstrap-3.3.7-dist/js/fileinput.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/bootstrap-3.3.7-dist/js/locales/zh.js"></script>
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/bootstrap-3.3.7-dist/css/fileinput.css">


</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <!--  <div class="form-group col-sm-2">
                  <select class="form-control" placeholder="请选择" v-model="q.channel" @keyup.enter="query">
                      <option disabled value="">请选择</option>
                      <option v-for="channel in channels">{{channel.name}}</option>
                  </select>
              </div>
              <a class="btn btn-default" @click="query">查询</a>
              <#if shiro.hasPermission("news:topic:save")>
              <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
          </#if>-->
        <#if shiro.hasPermission("convenienceSer:convenienceInfo:update")>
        <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
    </#if>
   <!-- <#if shiro.hasPermission("news:topic:delete")>
    <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
</#if>-->
</div>
<table id="jqGrid"></table>
<div id="jqGridPager"></div>
</div>

<div v-show="!showList" class="panel panel-default">
    <div class="panel-heading">{{title}}</div>
    <form class="form-horizontal" style="width:90%!important;">
        <div class="form-group">
            <!--
             <div class="col-sm-2 control-label" style="width: 10%;">作者</div>
             <div class="col-sm-10" style="width: 40%;">
                 <input type="text" class="form-control" width="80%" v-model="topic.author" placeholder="作者"/>
             </div>

             <div class="col-sm-2 control-label" style="width: 10%;" >公告类型</div>
             <div class="col-sm-10" style="width: 40%;" >
                 <select class="form-control" placeholder="请选择" v-model="topic.cid">
                     <option disabled value="">请选择</option>
                     <option v-for="channel in channels" :key="channel.id" :value="channel.id">{{channel.name}}</option>
                 </select> -->
            <!--<span>Selected: {{ channelSelected }}</span>-->
            <!-- </div>
         </div>

         <div class="form-group">
             <div class="col-sm-2 control-label" style="width: 10%;">标题</div>
             <div class="col-sm-10" style="width: 40%;">
                 <input type="text" class="form-control" width="80%" v-model="topic.title" placeholder="标题"/>
             </div>

             <div class="col-sm-2 control-label" style="width: 10%;">发布时间</div>
             <div class="col-sm-10" style="width: 40%;">
                 <input id="publish_date" v-model="topic.publishDate" type="text" class="form-control" style="z-index: 1000;">
             </div>
         </div>-->

            <div class="form-group">
                <div class="col-sm-2 control-label" style="width: 10%;">发布内容</div>
                <div class="col-sm-10" style="width: 90%;">
                    <script id="editor" type="text/plain" v-model="convenience.content"></script>
                   <!-- 实例化编辑器 -->
                    <script type="text/javascript">
                        var ue = UE.getEditor('editor');
                    </script>
                </div>
            </div>
                   <!-- <script type="text/javascript">
                        //js获取项目根路径，如： http://localhost:8083/uimcardprj
                        function getRootPath() {
                            //获取当前网址，如： http://localhost:8083/uimcardprj/share/meun.jsp
                            var curWwwPath = window.document.location.href;
                            //获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
                            var pathName = window.document.location.pathname;
                            var pos = curWwwPath.indexOf(pathName);
                            //获取主机地址，如： http://localhost:8083
                            var localhostPaht = curWwwPath.substring(0, pos);
                            //获取带"/"的项目名，如：/uimcardprj
                            var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
                            return (localhostPaht + projectName);//http://localhost:8083/uimcardprj
                        }

                        var ue = UE.getEditor('editor');
                        UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
                        UE.Editor.prototype.getActionUrl = function (action) {
                            console.log(action);
                            if (action === 'uploadimage' || action === 'uploadscrawl' || action === 'uploadimage') {
                                console.log(getRootPath() + '/common/file/upload/ueSaveFile');
                                return getRootPath() + '/common/file/upload/ueSaveFile';
                            } else if (action === 'listimage') {
                                return this._bkGetActionUrl.call(this, action);
                            } else {
                                return this._bkGetActionUrl.call(this, action);
                            }
                        };
                    </script>-->

            <!-- <div class="form-group">
                 <div class="col-sm-2 control-label" style="width: 10%;">手机缩略图</div>
                 <div class="col-sm-10" style="width: 40%;">
                 <input class="form-control" id="myFile" type="file" name="file" class="fileloading"/>
                 <span class="help-block">显示在手机中的缩略图建议宽210px高120px</span>
                 </div>
             </div>

             <div class="form-group">
                 <div class="col-sm-2 control-label" style="width: 10%;">是否发布</div>
                 <div class="col-sm-10" style="width: 40%;">
                     <select class="form-control" width="80%" v-model="topic.status" >
                         <option disabled value="">请选择</option>
                         <option value="1">是</option>
                         <option value="0">否</option>
                     </select>
                 </div>
             </div>

             <div class="form-group">
                 <div class="col-sm-2 control-label" style="width: 10%;"></div>
                 <div class="col-sm-10" style="width: 40%;">
                     <input type="hidden" class="form-control" width="80%" v-model="topic.logo" placeholder=""/>
                 </div>
             </div>-->

            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </div>
    </form>
</div>
</div>

<script src="${request.contextPath}/statics/js/modules/convenienceSer/convenienceInfo.js?_${.now?long}"></script>
</body>

<script>

</script>
</html>